package fun.chutianshu.eescore_full.controller;

import fun.chutianshu.eescore_full.entity.Exam;
import fun.chutianshu.eescore_full.service.ExamService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 考试表(Exam)表控制层
 *
 * @author makejava
 * @since 2021-04-30 15:36:09
 */
@RestController
@RequestMapping("exam")
public class ExamController {
    /**
     * 服务对象
     */
    @Resource
    private ExamService examService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne/{id}")
    public Exam selectOne(@PathVariable(name = "id") Long id) {
        return this.examService.queryById(id);
    }


    @PostMapping("deletebyid/{id}")
    public Boolean deleteById(@PathVariable(name = "id") Long id) {
        return this.examService.deleteById(id);
    }
}
